<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

	<title>Test Dijit Internal Event: "ondijitclick"</title>

	<script type="text/javascript" src="../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true"></script>
	<script type="text/javascript">
		dojo.require("doh.runner");
		dojo.require("dijit._Widget");
		dojo.require("dojo.parser");

		dojo.declare("dijit.MyWidget", dijit._Widget, {
			_eventHandler: function(){}
		});

		dojo.addOnLoad(function(){
			var connects = [];
			doh.register("_widgetConnect",
				[
					{
						name: "_Widget.connect x 100",
						runTest: function(t){
							var w = dijit.byId("widget1");
							var n = dojo.byId("externalNode");
							var sLen = w._connects.length;
							for(var i = 0; i < 100; i++){
								connects.push(w.connect(n, "onblur", "_eventHandler"));
							}
							t.is(100, w._connects.length - sLen);
						}
					},
					{
						name: "_Widget.connect - ondijitclick x 100",
						runTest: function(t){
							var w = dijit.byId("widget1");
							var n = dojo.byId("externalNode");
							var sLen = w._connects.length;
							for(var i = 0; i < 100; i++){
								connects.push(w.connect(n, "ondijitclick", "_eventHandler"));
							}
							t.is(100, w._connects.length - sLen);
						}
					},
					{
						name: "_Widget.disconnect x 200",
						runTest: function(t){
							var w = dijit.byId("widget1");
							var n = dojo.byId("externalNode");
							var sLen = w._connects.length;
							for(var i = 0; i < 200; i++){
								w.disconnect(connects[i]);
							}
							connects = [];
							t.is(200, sLen - w._connects.length);
						}
					}
				]
			);
			doh.run();
		});

	</script>
</head>
<body class="claro">
	<div id="externalNode"></div>
	<div id="widget1" dojoType="dijit.MyWidget"></div>
</body>
</html>
